<div style="min-height: 300px; padding-bottom: 20px; width: 98%; float: left" class="portlet x12">
	<div class="portlet-header">
		<h4>Danh sách bài viết
		
		<div class="buttonrow" style="float: right; margin-right: 20px;">
		<a href="<?php echo base_url ();?>admin/news/form_add_news">
				<input type="button" value="Thêm bài viết" class="btn btn-orange"></a></div>
				
		</h4>
		</div> <!-- .portlet-header -->
		
		<table>
		
		 <!-- them phan header -->
		 <thead>
				<tr>
					<th style="width: 70%;">Tên bài viết</th>
					<th>Chức năng</th>
				</tr>
			</thead>	
		<!-- ket thuc them head -->	
		<?php
		  foreach($list as $row_news)
		   {
		   $id = $row_news['id'];
		   $base = base_url();
		   echo '<tr>';
		   echo '<td>'.$row_news['ten_news'].'</td>';
		?>

		       <!-- dua button xoa ra -->
				<td>
				<input type="button" value="Sửa" class="btn btn-red"
					onclick="sua_item('<?php echo $id;?>')">
				<input type="button" value="Xóa" class="btn btn-green"
					onclick="del_item('<?php echo $id;?>')">
			    </td>
				
				<script>
				function del_item(id){
						var store_del = confirm("Xoa bai viet ?");
					if(store_del==true){
						window.location="<?php echo base_url();?>admin/news/xoanew/"+id;
					}else{
						return false;
					}		
				}
				
				function sua_item(id){
				 window.location="<?php echo base_url();?>admin/news/form_sua_new/"+id;
				}
				</script>
				
				<!-- ket thuc dua button xoa -->
        <?php		
		   echo '</tr>';
		   }
		?>
		</table>
		
</div>	<!-- .portlet x12 -->	
